class InterLeechdomsController < ApplicationController
  layout "main"
  # GET /inter_leechdoms
  # GET /inter_leechdoms.xml
  def index
    @body_id = "leechdoms"
    @inter_leechdoms = InterLeechdom.paginate  :page => params[:page], :per_page => 30, :conditions => ["cpmczw like ?","%#{params[:search]}%"]
    
    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @inter_leechdoms }
    end
  end
  
  # GET /inter_leechdoms/1
  # GET /inter_leechdoms/1.xml
  def show
    @body_id = "leechdoms"
    @inter_leechdom = InterLeechdom.find(params[:id])
    @page_title = @inter_leechdom.spmzw + " " + @inter_leechdom.cpmczw
    @comments = Comment.find(:all, :conditions => ["leechdom_id = ? and commentable_type = ?",params[:id],"inter_leechdoms"])
    session[:original_uri] = request.request_uri
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @inter_leechdom }
    end
  end  
end
